<%@ page language="java" pageEncoding="UTF-8" 
	import="java.util.*" 
	import="net.sf.json.JSONObject" 
%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" 
						+ request.getServerPort() + path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>HTTP请求参数测试</title>
</head>

<body>
	<%
		Map<String, Object> map = new HashMap<String, Object>();
		
		map.put("AbsolutePath", application.getRealPath("httpTest.jsp"));
		map.put("Protocol", request.getProtocol());
		map.put("Scheme", request.getScheme());
		map.put("ServerName", request.getServerName());
		map.put("ServerPort", request.getServerPort());
		map.put("ServerInfo", getServletConfig().getServletContext().getServerInfo());
		map.put("RemoteAddr", request.getRemoteAddr());
		map.put("RemoteHost", request.getRemoteHost());
		map.put("CharacterEncoding", request.getCharacterEncoding());
		map.put("ContentLength", request.getContentLength());
		map.put("ContentType", request.getContentType());
		map.put("AuthType", request.getAuthType());
		map.put("HTTPMethod", request.getMethod());
		map.put("PathInfo", request.getPathInfo());
		map.put("PathTranslated", request.getPathTranslated());
		map.put("QueryString", request.getQueryString());
		map.put("RemoteUser", request.getRemoteUser());
		map.put("RequestedSessionId", request.getRequestedSessionId());
		map.put("RequestURI", request.getRequestURI());
		map.put("ServletPath", request.getServletPath());
		map.put("Header_Accept", request.getHeader("Accept"));
		map.put("Header_Host", request.getHeader("Host"));
		map.put("Header_Referer", request.getHeader("Referer"));
		map.put("Header_Accept-Language", request.getHeader("Accept-Language"));
		map.put("Header_Accept-Encoding", request.getHeader("Accept-Encoding"));
		map.put("Header_User-Agent", request.getHeader("User-Agent"));
		map.put("Header_Connection", request.getHeader("Connection"));
		map.put("Cookie", request.getHeader("Cookie"));
		map.put("SessionCreationTime", session.getCreationTime());
		map.put("SessionLastAccessed", session.getLastAccessedTime());
		
		map.put("userId", session.getAttribute("loginedUserId"));
		map.put("userName", session.getAttribute("loginedUserName"));
		
		out.println(JSONObject.fromObject(map).toString());
	%>
</body>
</html>
